#pragma once

class CWindowRect : public CRect
{
public:
	CWindowRect()
	{
	}

	CWindowRect(CWnd* pWnd)
	{
		if(pWnd != NULL)
			pWnd->GetWindowRect(this);
	}

	CWindowRect(HWND hWnd)
	{
		if(hWnd == NULL)
			::GetWindowRect(hWnd, this);
	}
};

class CClientRect : public CRect
{
public:
	CClientRect()
	{
	}

	CClientRect(CWnd* pWnd)
	{
		if(pWnd != NULL)
			pWnd->GetClientRect(this);
	}

	CClientRect(HWND hWnd)
	{
		if(hWnd == NULL)
			::GetClientRect(hWnd, this);
	}
};

class CScreenRect : public CRect
{
public:
	CScreenRect(bool bMonitorMouseInside = false)
	{
		if(bMonitorMouseInside)
		{
			CPoint ptCursor;
			GetCursorPos(&ptCursor);

			HMONITOR hMonitor = MonitorFromPoint(ptCursor, MONITOR_DEFAULTTOPRIMARY);

			MONITORINFO mi = { sizeof(MONITORINFO) };
			GetMonitorInfo(hMonitor, &mi);

			static_cast<CRect&>(*this) = mi.rcMonitor;
		}
		else
		{
			left = 0;
			top = 0;
			right = GetSystemMetrics(SM_CXSCREEN);
			bottom = GetSystemMetrics(SM_CYSCREEN);
		}
	}
};